package cn.com.nes.site.service.crm.customer;

import cn.com.nes.mybatis.agent.crm.entity.CustomerHouse;
import cn.com.nes.site.entity.PageData;
import cn.com.nes.site.entity.bo.workorder.ReplenishHouseInfoByCustomerBO;
import cn.com.nes.site.entity.vo.NullVO;
import cn.com.nes.site.entity.vo.crm.CustomerHouseVO;
import cn.com.nes.site.entity.vo.crm.DelCustomerHouseInfoVO;
import cn.com.nes.site.entity.vo.crm.GetCustomerHousePageVO;
import cn.com.nes.site.entity.vo.workOrder.ReplenishHouseInfoVO;
import cn.com.nes.site.service.crm.customer.bo.CustomerHouseBO;
import cn.com.nes.site.service.crm.customer.dto.CustomerHouseDTO;
import cn.com.nes.site.service.crm.customer.dto.HouseDTO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 客户房屋信息服务
 */
public interface CustomerHouseService extends IService<CustomerHouse> {

    /**
     * 保存客户房屋信息
     */
    CustomerHouse saveHouseInfo(CustomerHouseVO crmCustomerHouseVO);

    /**
     * 保存客户房屋
     */
    CustomerHouse saveCustomerHouse(CustomerHouseBO customerHouseBO);

    /**
     * 查询客户房屋详情
     */
    CustomerHouseDTO getHouseDetail(Long houseId) throws Exception;

    /**
     * 查询客户房屋详情
     */
    HouseDTO getHouseDetail(String houseUuid);


    CustomerHouse getCustomerHouse(String houseUuid);

    /**
     * Retrieves a customer's house information based on the area code, address, and customer UUID.
     *
     * @param areaCode   The administrative division code where the house is located.
     * @param address    The full address of the customer's house.
     * @param customerUuid The unique identifier of the customer associated with the house.
     * @return A {@link CustomerHouse} object containing detailed information about the customer's house.
     * @throws Exception If an error occurs during the retrieval process.
     */
    CustomerHouse getCustomerHouse(String areaCode, String address, String customerUuid) throws Exception;

    CustomerHouse getHouse(String houseUuid);

    void replenishHouseInfo(ReplenishHouseInfoVO vo) throws Exception;

    /**
     * 根据客户信息补充房屋信息
     */
    void replenishHouseInfoByCustomer(ReplenishHouseInfoByCustomerBO bo) throws Exception;

    /**
     * 查询客户房屋采暖所需制热量
     */
    BigDecimal getHouseNeedHeat(Long aLong) throws Exception;

    @Deprecated
    CustomerHouse getHouseInfo(String houseUuid) throws Exception;

    void deleteByCustomerIds(List<String> customerIdList, Long operateUserId, Date operateDate);

    /**
     * 根据门牌号模糊查询房屋id列表
     */
    List<Long> getHouseIdListByHouseNumber(String houseNumber);

    /**
     * 查询客户房屋分页信息
     */
    Page<HouseDTO> getHousePage(CustomerHouseBO customerHouseBO);

    /**
     * 查询客户房屋分页信息
     */
    @Deprecated
    Page<CustomerHouseDTO> getHousePage(GetCustomerHousePageVO vo) throws Exception;

    /**
     * 查询客户房屋信息
     */
    List<CustomerHouseDTO> getCustomerHouse(GetCustomerHousePageVO vo) throws Exception;

    /**
     * 删除客户房屋信息
     */
    PageData delHouseInfo(DelCustomerHouseInfoVO vo) throws Exception;

    /**
     * 下拉框
     */
    PageData saveHouseDropdownBox(NullVO vo) throws Exception;

    /**
     * 查询或创建房屋信息
     */
    CustomerHouse queryOrSaveCustomerHouse(CustomerHouseBO customerHouseBO);

}
